<?php
class HtmlWidget extends CInputWidget
{
    public function run()
    {
        echo '<div style="overflow: hidden;padding-bottom: 5px;">';
        $options = array();
        $options['theme_advanced_buttons1'] = "cut,copy,paste,pastetext,pasteword,|,search,replace,|,undo,redo,|,removeformat,cleanup,|,spellchecker,|,visualaid,visualchars,|,ltr,rtl,|,code,preview,fullscreen,|,help";
        $options['forced_root_block']=false;
        $options['force_br_newlines']=true;
        $options['force_p_newlines']=false;
        $options['relative_urls']=false;
        $options['remove_script_host']=true;
        $options['document_base_url']='http://'.parse_url(Yii::app()->request->hostInfo, PHP_URL_HOST);
        
        $this->widget('Core.components.tinymce.ETinyMce', array(
            'name'=>$this->name,
            'value'=>$this->value,
            'width'=>'530px',
            'height'=>'500px',
            'editorTemplate'=>'full',
            'options'=>$options,
            'htmlOptions'=>$this->htmlOptions,
        ));
        echo '</div>';
    }
}